package com.leetcode.题库;

import java.util.Arrays;

/**
 * @author 覃国强
 * @date 2022-03-16 19:41
 */
public class 题库_0561_数组拆分I {

  static
  class Solution {
    public int arrayPairSum(int[] nums) {
      Arrays.sort(nums);
      int answer = 0;
      for (int i = 0; i < nums.length; i += 2) {
        answer += nums[i];
      }
      return answer;
    }
  }

}
